package com.mars.admin.modules.post.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.mars.admin.modules.post.entity.PostComment;
import com.mars.admin.modules.user.vo.UserInfoVO;
import com.mybatisflex.annotation.*;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.awt.*;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Schema(description = "帖子评论用户信息VO")
public class PostConmentVO {
    private static final long serialVersionUID = 1L;

    /**
     * 评论ID
     */
    @Id(keyType = KeyType.Auto)
    @Schema(description = "评论ID", example = "1")
    private Long id;

    /**
     * 帖子ID
     */
    @Schema(description = "帖子ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("post_id")
    private Long postId;

    /**
     * 评论用户ID
     */
    @Schema(description = "评论用户ID", example = "1", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("user_id")
    private Long userId;

    /**
     * 父评论ID
     */
    @Schema(description = "父评论ID", example = "1")
    @Column("parent_id")
    private Long parentId;

    /**
     * 回复用户ID
     */
    @Schema(description = "回复用户ID", example = "2")
    @Column("reply_user_id")
    private Long replyUserId;

    /**
     * 评论内容
     */
    @Schema(description = "评论内容", example = "很棒的分享！", requiredMode = Schema.RequiredMode.REQUIRED)
    @Column("content")
    private String content;

    /**
     * 评论图片
     */
    @Schema(description = "评论图片", example = "[\"https://example.com/1.jpg\"]")
    @Column("images")
    private String images;

    /**
     * 点赞数
     */
    @Schema(description = "点赞数", example = "5")
    @Column("like_count")
    private Integer likeCount;

    /**
     * 回复数
     */
    @Schema(description = "回复数", example = "2")
    @Column("reply_count")
    private Integer replyCount;

    /**
     * 是否置顶
     */
    @Schema(description = "是否置顶：0-否，1-是", example = "0")
    @Column("is_top")
    private Integer isTop;

    /**
     * 状态
     */
    @Schema(description = "状态：1-正常，2-已删除，3-审核中，4-审核拒绝", example = "1")
    @Column("status")
    private Integer status;


    /**
     * 评论用户信息
     */
    @Schema(description = "评论用户信息")
    @RelationOneToOne(selfField = "userId",targetField = "id",targetTable = "tb_user")
    private UserInfoVO userInfo;
    /**
     * 被评论用户信息
     */
    @Schema(description = "被评论用户信息")
    @RelationOneToOne(selfField = "replyUserId",targetField = "id",targetTable = "tb_user")
    private UserInfoVO replyUserInfo;
}
